using System;
using System.Collections.Generic;
using System.Text;

namespace Stormwind.Core.Data {
	/// <summary>
	/// Defines a field definition in a DataSource.
	/// </summary>
	public class FieldDefinition {
		private DataSource dataSource;
		private string propertyName;
		private DataTypes propertyType;
		private bool isFilterable;

		/// <summary>
		/// Data source that this field belongs to.
		/// </summary>
		public DataSource DataSource {
			get {
				return dataSource;
			}
			set {
				dataSource = value;
			}
		}

		/// <summary>
		/// Property name for this field.
		/// </summary>
		public string PropertyName {
			get {
				return propertyName;
			}
			set {
				propertyName = value;
			}
		}

		/// <summary>
		/// Type of the property.
		/// </summary>
		public DataTypes PropertyType {
			get {
				return propertyType;
			}
			set {
				propertyType = value;
			}
		}

		/// <summary>
		/// Indicates if this is a filterable field.
		/// </summary>
		public bool IsFilterable {
			get {
				return isFilterable;
			}
			set {
				isFilterable = value;
			}
		}

		/// <summary>
		/// Returns the Class.PropertyName string.
		/// </summary>
		public string FullPropName {
			get {
				return string.Format("{0}.{1}", DataSource.ClassName, PropertyName);
			}
		}
	}
}
